package com.juicygames.framework.draw.drawservice;

import com.juicygames.framework.GameAction;
import com.juicygames.framework.action.DrawAction;
import com.juicygames.framework.draw.DrawService;
import com.juicygames.framework.gamepart.GameHandler;
import com.juicygames.framework.gamepart.GamePart;

public class DrawHandler extends GameHandler {
	
	DrawService drawService;
	
	public DrawHandler(GamePart self) {
		super(self);
		drawService = (DrawService)self;
		setActionClassHandled(DrawAction.class);
	}

	public void handle(GameAction action) {
		for (Drawable drawable : drawService.getDrawables()) {
			action.apply(drawable.entity);
		}
	}
	

}
